Mob feud rages in Equatorial Byteotia. The mob bosses have come to the country's capital, Byteburg, to settle the dispute. Negotiations were very tense, and at one point the trigger-happy participants drew their guns. Each participant aims at another with a pistol. Should they go on a killing spree, the shooting will go in accordance with the following code of honour:
Write a programme that:
The first line of the standard input contains the number of participants
(
).
They are numbered from
to
.
The second line contains
integers
,
separated by single spaces,
.
denotes the number of
participant's target.
Note that it is possible that
for some
(the nerves, you
know).
Your programme should write out two integers separated by a single space in the first and only line of the standard output. These numbers should be, respectively, the minimum and maximum number of casualties resulting from the shooting.
For the input data:
8 2 3 2 2 6 7 8 5

the correct result is:
3 5
Task author: Wojciech Rytter.
W razie problemów technicznych ze Szkopułem, prosimy o kontakt mailowy pod adresem szkopul@fri.edu.pl.
Jeśli chciałbyś porozmawiać o zadaniach, rozwiązaniach lub problemach technicznych, odwiedź nasze serwery na Discordzie. Są one moderowane przez społeczność, ale członkowie zespołu wsparcia również aktywnie się tam udzielają.